Help-info on scriptable telnet client: ===command line parameters=== /run [min|max] /s scriptfile /l logfile /o outputfile ...[-defines] run min: start window minimized max: start window maximized otherwise, starts 'as designed' defines: variable value command line variables follow the same syntax as the script defines, except that the variable name must be preceded by a '-' or '/' defines added on the command line are considered permanent, and thus can only by changed at runtime by specifying '-force' ===edit mode=== the program has a build-in editor facility when making changes to a script with the embedded editor. when expanding the includes, the editing is disabled, as the include-part is not changeable. to be able to edit, one should not expand the includes. when going out of edit-mode, the script's changes are kept in memory, but not automatically saved to file. To save them, do 'save' or 'save as' before exiting edit mode, or return to edit-mode. The 'undo' option goes back to the state at the the last 'apply' or the last time edit mode was exited. ===general remarks=== - manual data input: when connected (during script execution), one can enter keyboard-input in the telnet window to interact with the running script. entered data will be send to the server - special send-value streams \n new line (CRLF) \r carriage return (CR) \f linefeed (LF) \t tab (TAB) \e excape (ESC) \x.. any hex value .. (must be specified in lowercase!!!) - string values all values containing spaces should be embedded between double quotes ("") - string comparison (waitfor, onreceive, if) comparison of values is not case-sensitive, unless specified on the command ('cs') do not embed conditions, i.e. only one level of condition is possible - variables send / waitfor / onreceive / connect strings/values on these commands can contain variables, as defined by the define-script command or on the command line. before handled, the variable will be replaced by it's current value when defined between '<' and '>' - send/receive processes a receive-process must sequentially follow the send it is related to. thus, do not put a goto between the send and the first receive-related command (onreceive/waitfor) further in the receive process, goto's can be used, jumping in or out the receive process ===special directives in script=== .include xxxxxxxx include at this location the contents of file xxxxxxxx embedded includes are possible up to 10 levels max ===script commands and syntax=== // is used as comment delimitor. it can be used at the start of a line (comment-line), or on a command line, from where data is ignored (considered comment) do not use //#-# as start of a comment line, it is for internal usage on one line, multiple commands can be given (though not recommended for readablility) the only advantage of multiple commands on one line is on the 'if' and 'onreceive' commands, where the 'end' directive must not (may not) be given when putting the conditional commands on the same line. In these commands, the commands on the same line are part of the condition, and the 'end' is implicit by the end of the line. define variable value [-force | -perm] variable: any value that can be used afterwards as re-definitions of an existing variable overwrites the previous value, unless the variable was defined before with the option '-perm' (permanent) permanent variables are only changeable by re-assigning them with option 'force' note that command-line definitions are considered as permanent, and thus only changeable using -force when forcing permanent variables, -perm must be re-specified if they must stay permanent values may contain previous defined variable references (<...>), except when defining encrypted variables special values: /keys: defines ESC and CTRL-A to CTRL-Z variables when the variable is preceded by a period: value will be encrypted at first usage e.g. define uid myuser define .pwd mypassword define /keys set logging x loglevel, value from 0 to 9 default 1. reasonable value is up to 5 higher is only used for debugging purpose set datatype binary received data is considered to contain binary data, which will be replaced by ~ before output set datatype ansi received data is considered to contain screen formatting codes following the ansi standard. these will be converted 'best effort' to formatting in the output buffer. remaining non-displayable characters will be replaced by ~ before output set datatype text received data is considered to contain text only, and will be displayed asis set sessiontimeout 500 time in seconds after which the session will be forced to stop set idletimeout 100 time in seconds of non-activity after which the session will be forced to stop set loopcount 100 maximum number of times a receive process can be re-executed, before it is considered to be in a loop and the session is stopped. set interrupt "any string" string to be sent to interrupt communication when needed setting to empty string will disable interrupt possibility used to prematurely stop telnet when exceeding timeouts by default \x03 (=ctrl-c) set interactive on|off enables/disables gui input in the telnet window connect host port connect to host:port e.g. connect 10.0.0.1 23 connect if "any string" "any string" [-cs] ...commands end if "any string" "any string" [-cs] ...commands used to conditionally execute commands in send or receive processing. comparable to onreceive, but compares the 2 specified strings. special if's: if defined ...variable... if undefined ...variable... returns true/false depending on wether the variable has already been assigned do not specify <> nor the possible leading period for the variable name. e.g. if ...variable... "server1" define .pw 1234 onreceive "any string" [-cs] ...commands end onreceive "any string" [-cs] ...commands commands to execute when given string is encountered in the received data any meaningful command can be specified, like send, goto, wait one or more onreceive's should be followed by a wait or waitfor , otherwise the script will continue without waiting for the specified data waitfor "any string" [-cs] wait until specified string is received, after which the script will continue goto anylabel :anylabel jump to any label a jump can only be forward, no backward jumps a jump in an onrecieve process may be in or out the onreceive-end sequence. wait sss wait sss seconds before continuing. used after an onreceive sequence, to take the appropriate time to get the expected data, or at any other occasion to make the process to wait send "any string" send the data (after replacement of the variables by their current value) e.g. send \n send send "the text with and \x0d" disconnect disconnect session exit [now] exit script a disconnect will be done if the session is not 'disconnected'. when specifying 'now' as option, disconnect will not be done, no matter the session status.